load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test")

go_library(
    name = "contentionutils",
    srcs = ["concurrent_buffer_guard.go"],
    importpath = "github.com/cockroachdb/cockroach/pkg/sql/contention/contentionutils",
    visibility = ["//visibility:public"],
    deps = ["//pkg/util/syncutil"],
)

go_test(
    name = "contentionutils_test",
    srcs = ["concurrent_buffer_guard_test.go"],
    embed = [":contentionutils"],
    deps = [
        "//pkg/util/leaktest",
        "//pkg/util/log",
        "//pkg/util/syncutil",
        "//pkg/util/uuid",
        "@com_github_stretchr_testify//require",
        "@org_golang_x_exp//rand",
    ],
)
